//
//  UIScrollView+Chained.m
//  ObjectCChained
//
//  Created by sny on 2018/5/18.
//  Copyright © 2018年 HuangYangYang. All rights reserved.
//

#import "UIScrollView+Chained.h"

@implementation UIScrollView (Chained)

- (UIScrollView *(^)(BOOL ,BOOL ))chainedScrollIndicator {
    return ^UIScrollView *(BOOL showsVertical,BOOL showsHorizontal) {
        self.showsHorizontalScrollIndicator = showsHorizontal;
        self.showsVerticalScrollIndicator = showsVertical;
        return self;
    };
}

- (UIScrollView *(^)(CGSize ))chainedScrollContentSize {
    return ^UIScrollView *(CGSize contentSize) {
        self.contentSize = contentSize;
        return self;
    };
}

- (UIScrollView *(^)(BOOL , BOOL))chainedScrollEnabled {
    return ^UIScrollView *(BOOL scrollEnabled,BOOL pagingEnabled) {
        [self setScrollEnabled:scrollEnabled];
        [self setPagingEnabled:pagingEnabled];
        return self;
    };
}

- (UIScrollView *(^)(id))chainedScrollDelegate {
    return ^UIScrollView *(id delegateObject) {
        if (delegateObject) {self.delegate = delegateObject;}
        return self;
    };
}

- (UIScrollView *(^)(BOOL ,BOOL ))chainedScrollBounces {
    return ^UIScrollView *(BOOL bounces,BOOL bouncesZoom) {
        self.bounces = bounces;
        self.bouncesZoom = bouncesZoom;
        return self;
    };
}


#pragma mark - setter

- (void)setChainedScrollIndicator:(UIScrollView *(^)(BOOL, BOOL))chainedScrollIndicator {}

- (void)setChainedScrollContentSize:(UIScrollView *(^)(CGSize))chainedScrollContentSize {}

- (void)setChainedScrollEnabled:(UIScrollView *(^)(BOOL, BOOL))chainedScrollEnabled {}

- (void)setChainedScrollDelegate:(UIScrollView *(^)(id))chainedScrollDelegate {}

- (void)setChainedScrollBounces:(UIScrollView *(^)(BOOL, BOOL))chainedScrollBounces {}

@end
